<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="statusmudanca" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{statusmudancaHome.managed ? 'Edit' : 'Add'} Statusmudanca</f:facet>



            <s:decorate id="nomeField" template="layout/edit.xhtml">
                <ui:define name="label">Nome</ui:define>
                <h:inputTextarea id="nome"
                               cols="80"
                               rows="3"
                              value="#{statusmudancaHome.instance.nome}"/>
            </s:decorate>


            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{statusmudancaHome.persist}"
                       disabled="#{!statusmudancaHome.wired}"
                       rendered="#{!statusmudancaHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{statusmudancaHome.update}"
                       rendered="#{statusmudancaHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{statusmudancaHome.remove}"
                      immediate="true"
                       rendered="#{statusmudancaHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Statusmudanca.xhtml"
                rendered="#{statusmudancaHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty statusmudancaFrom ? 'StatusmudancaList' : statusmudancaFrom}.xhtml"
                rendered="#{!statusmudancaHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Solicitacaomudancas">
        <h:form styleClass="association" id="solicitacaomudancasChildren">

            <h:outputText value="There are no solicitacaomudancas associated with this statusmudanca."
                       rendered="#{empty statusmudancaHome.solicitacaomudancas}"/>

            <rich:dataTable value="#{statusmudancaHome.solicitacaomudancas}"
                           var="_solicitacaomudanca"
                      rendered="#{not empty statusmudancaHome.solicitacaomudancas}"
                    rowClasses="rvgRowOne,rvgRowTwo"
                            id="solicitacaomudancasTable">
                <rich:column sortBy="#{_solicitacaomudanca.id}">
                    <f:facet name="header">Id</f:facet>
                    <h:outputText value="#{_solicitacaomudanca.id}"/>
                </rich:column>
                <rich:column sortBy="#{_solicitacaomudanca.dataabertura}">
                    <f:facet name="header">Dataabertura</f:facet>
                    <h:outputText value="#{_solicitacaomudanca.dataabertura}">
                        <s:convertDateTime type="both" dateStyle="short"/>
                    </h:outputText>
                </rich:column>
                <rich:column sortBy="#{_solicitacaomudanca.datafechamento}">
                    <f:facet name="header">Datafechamento</f:facet>
                    <h:outputText value="#{_solicitacaomudanca.datafechamento}">
                        <s:convertDateTime type="both" dateStyle="short"/>
                    </h:outputText>
                </rich:column>
                <rich:column sortBy="#{_solicitacaomudanca.descricao}">
                    <f:facet name="header">Descricao</f:facet>
                    <h:outputText value="#{_solicitacaomudanca.descricao}"/>
                </rich:column>
                <rich:column sortBy="#{_solicitacaomudanca.justificativa}">
                    <f:facet name="header">Justificativa</f:facet>
                    <h:outputText value="#{_solicitacaomudanca.justificativa}"/>
                </rich:column>
                <rich:column sortBy="#{_solicitacaomudanca.titulo}">
                    <f:facet name="header">Titulo</f:facet>
                    <h:outputText value="#{_solicitacaomudanca.titulo}"/>
                </rich:column>
            </rich:dataTable>

        </h:form>

        <f:subview rendered="#{statusmudancaHome.managed}" id="solicitacaomudancas">
        <div class="actionButtons">
            <s:button id="addsolicitacaomudanca"
                   value="Add solicitacaomudanca"
                    view="/SolicitacaomudancaEdit.xhtml"
             propagation="none">
                 <f:param name="statusmudancaId"
                         value="#{statusmudancaHome.instance.id}"/>
                 <f:param name="solicitacaomudancaFrom" value="Statusmudanca"/>
            </s:button>
        </div>
        </f:subview>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
